Hello,
i'm trying to create a feature that tracks how often a menuItem has been executed by the users.
We want to identify how critical changes to our tools can be and how many users are affected.
We are already using the createMenu and createItem functions to build our DOORS menues in the DB Explorer
and in modules. According to the DXL help its possible to use a dxlcallback instead of a DXL file reference.
THe first file loader.inc ist stored under lib\dxl\startupFiles:
// This function will normally have some parameters
void loader(string sFile)
{
print "" sFile " executed ..."
infoBox "Test"
}
The secondy file (formalMenu.inc) with the menu is stored under lib\dxl\config\formalFiles\
createMenu(moduleMenu,"Menu",'M',null)
createMenu(moduleMenu,"Submenu",'S',null)
createItem(menuAvailable_ ,loader("C:/temp/test.dxl") ,"Start",'S', 'Y', null, null, null, "2", "3")
end menu
end menu
createMenu(moduleMenu,"Menu2",'M',null)
createMenu(moduleMenu,"Submenu2",'S',null)
createItem(alwaysOn ,"Start 2",'A', null, null, null, null, "Start 2", "Start 2","C:/temp/test.dxl")
end menu
end menu
So now the problem:
After starting DOORS and opening a module teh top menues "Menu" and "Menu2" are displayed correctly, but when trying
to browse the menu DOORS is crashing with a diagnostic log and the attached errors.
For me it looks like, that the function loader() is directly executed when opening the module/displaying the menu.
According to the manual it should be executed after the user clicks the item.
Does anyone have a solution for this and/or has the same behaviour.
Many Thanks for any help you can give
SystemAdmin - Fri Oct 19 14:48:50 EDT 2012 |
Re: createItem causing DOORS crash while browsing the menu llandale - Mon Oct 22 13:50:49 EDT 2012
From the DXL manual:
void createItem(int mappingFunction(),
void dxlCallback(),
string label,
char mnemonic,
char accelerator,
int modifierKeyFlags,
{IconID icon_id|string iconFileName},
string tooltip,
string helptext,
string inactiveHelp)
That 2nd parameter "void dxlCallback()" means the callback function MUST have no parameters and MUST have a void return value.
-Louie
|